/* * File: user_input.c * Author: alex * * Created on September 14, 2016, 2:11 PM */ #include #include /* Compile: gcc -o userimp user_input.c Run one way: ./userimp.exe Run another way (do not change the code or anything else. make sure that the executable and hello_data1.txt are in the same folder): ./userimp.exe < hello_data1.txt */ int main(int argc, char** argv) { char str1[101], str2[101]; int n, a,b,c; printf("Please enter a word (less than 100 letters):"); scanf("%s", str1); printf("Please enter another word (less than 100 letters):"); scanf("%s", str2); printf("Please enter a number:"); scanf("%d", &n); printf("You entered first: %s\n", str1); printf("You entered second: %s\n", str2); printf("The number was: %d\n", n); printf("Example for reading 3 numbers from teh same line:\n"); printf("Please enter 3 numbers separated by a space:"); scanf("%d %d %d", &a, &b, &c); printf("The 3 numbers you gave are: %d,%d,%d\nBye", a,b,c); return (EXIT_SUCCESS); }